package com.xmy.cultivate.service.impl;

import com.xmy.cultivate.entity.LackCourseLog;
import com.xmy.cultivate.mapper.LackCourseLogMapper;
import com.xmy.cultivate.service.ILackCourseLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 缺课记录 服务实现类
 * </p>
 *
 * @author hpiggy
 * @since 2023-08-08
 */
@Service
public class LackCourseLogServiceImpl extends ServiceImpl<LackCourseLogMapper, LackCourseLog> implements ILackCourseLogService {

    /**
     * 更新为已补课
     * @param lackCourseLogId
     * @return
     */
    public boolean updateIsRepair(Long lackCourseLogId){
        try{
            LackCourseLog lackCourseLog = this.getById(lackCourseLogId);
            if (lackCourseLog != null){
                lackCourseLog.setIsRepair(1);
                this.updateById(lackCourseLog);
            }
        }catch (Exception e){
            return false;
        }
        return true;
    }
}
